<!DOCTYPE html>
<html lang="en">
<head>
<title><#:C('sitename')#>--代理商平台</title>
<meta name="keywords" content="<#:C('keyword')#>"/>
<meta name="description" content="<#:C('content')#>"/>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<include file="Pub:Css"/>
</head>
<body>
<include file="Pub:top"/>
<include file="Pub:nav"/>
<!--main-container-part-->
<div id="content">
  <!--breadcrumbs-->
    <div id="content-header">
        <div id="breadcrumb">
            <a href="<#:U('index/index')#>" title="返回首页" class="tip-bottom"><i class="icon-home"></i>首页</a>
            <a href="#" class="current">修改密码</a>
        </div>
        <h1>修改密码</h1>
    </div>
    <!--End-breadcrumbs-->
    <div class="container-fluid" >
        <hr>
        <div class="row-fluid">
            <div class="span8">
                <div class="widget-box">
                    <div class="widget-title">
                        <span class="icon"><i class="icon-align-justify"></i></span>
                        <h5>修改密码</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <form name='' class="form-horizontal">
                            <div class="control-group">
                                <div class="alert span9" style="display: none;margin: 10px 0 10px 150px;">
                                    <span id="alertmsg"></span>
                                </div>
                            </div>    
                            <div class="control-group">
                                <label class="control-label">帐号信息:</label>
                                <div class="controls">
                                    <input class="span11" type="text"  name="name" id="name" value="<#$Think.session.account#>" readonly="readonly"/>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">旧密码:</label>
                                <div class="controls">
                                    <input class="span11" type="password" name="oldpwd" id="oldpwd" value="<#$info.money#>" data-toggle="tooltip" data-trigger="focus" title="4-20个字符 ，数字,字母或下划线组成" data-placement="right" />
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">新密码:</label>
                                <div class="controls">
                                    <input class="span11" type="password" name="password" id="password" value="<#$info.money#>" data-toggle="tooltip" data-trigger="focus" title="4-20个字符 ，数字,字母或下划线组成" data-placement="right" />
                                </div>
                            </div>
                            <div class="control-group">
                                <input type="hidden" name="sid" id="sid" value="<#$info.id#>">
                                <input type="button" class="btn btn-success" id="btn_save" value="修改密码" style="margin: 20px;">
                            </div>
                        </form>
                    </div>
                    <div class="span4 column pull-right">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal  hide fade" id="myModal">
  <div class="modal-header">
    <a class="close" data-dismiss="modal">×</a>
    <h3>提示信息</h3>
  </div>
  <div class="modal-body">
    <p>内容</p>
  </div>
  <div class="modal-footer">
    <a href="#" class="btn"  data-dismiss="modal">关闭</a>
  </div>
</div>
<!-- scripts -->
<script src="<#$Theme['P']['js']#>/jquery.js"></script>
<script src="<#$Theme['P']['root']#>/bootadmin/js/bootstrap.min.js"></script>
<script src="<#$Theme['P']['root']#>/bootadmin/js/theme.js"></script>

<script src="<#$Theme['P']['root']#>/bootadmin/js/common.js"></script>
      
<!-- call this page plugins -->
<script type="text/javascript">
	
	 
    $(function () {
    	
        // add uniform plugin styles to html elements
       
        
        //$(".alert").alert('close');
		$('#btn_save').bind('click',function(){

			var s=$('#oldpwd').val();
			var link=$('#password').val();
			
			

			  if (s == "") {
				  AlertTips("旧密码不能为空",1500);
				
			      return false;
			  }
			  if (link == "") {
				  
				  AlertTips("新密码不能为空",1500);
			        return false;
			  }
			
			  $.ajax({
				  	url: '<#:U('dopwd')#>',
			        type: "post",
					data:{
						'oldpwd':s,
						'password':link,
						'__hash__':$('input[name="__hash__"]').val()
						},
					dataType:'json',
					error:function(){
		
							AlertTips("服务器忙，请稍候再试",1500);
							},
					success:function(data){
							if(data.error==0){
								$('#oldpwd').val('');
								$('#password').val('');
								$(".modal-body").html("<p>保存成功</p>");
								$('#myModal').modal('show');
							}else{
								AlertTips(data.msg,1500);
							}
					}
				  });
			});
        
    });
</script>
</body>
</html>
